function saveAsObject(){
    var obj1 = document.getElementById("input1");
    var data = [];
                    var person1 = new Object();
                    person1.name=obj1.value;
                    person1.age=18;
                    person1.sex="男";
                    data.push(person1);
                    
                    var person2 = new Object();
                    person2.name="小陈";
                    person2.age=20;
                    person2.sex="女";
                    data.push(person2);
                
                    var json_str = JSON.stringify(data);
    alert("json_str = " + json_str);
}